{extend name="layout/layout" /}

{block name="content"}
<link href="__STATIC__/plugins/ueditor/ueditor.css" rel="stylesheet" type="text/css" />
<style>
    #edui1_imagescale{display:none !important;}  /*点击上传的图片后出现的拉伸边框*/
    .edui-editor-bottomContainer{display: none;}
</style>
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 编辑</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form class="form-horizontal" method="post" enctype="multipart/form-data">
                    <div class="form-body">
                        <div class="row" style="margin-bottom: 10px;">
                            <div class="col-md-9">
                                <div class="form-inline">
                                    <label class="control-label col-md-3">
                                        所在地
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="hidden" class="cityId" value="{$info.cityId}">
                                        <input type="hidden" class="xianId" value="{$info.xianId}">
                                        <input type="hidden" class="townId" value="{$info.townId}">
                                        <input type="hidden" class="villageId" value="{$info.villageId}">

                                        {include file="common:selectarea" /}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        发布人
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline check-type">
                                                <input type="radio" class="" name="isParty" value="2" placeholder="" {if condition="($info['user']['isParty'] == 2)"}checked="checked"{/if} >
                                                乡村居民
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline check-type">
                                                <input type="radio" class="" name="isParty" value="1" placeholder="" {if condition="($info['user']['isParty'] == 1)"}checked="checked"{/if} >
                                                组织党员
                                                <span></span>
                                            </label>
                                        </div>
                                        <div class="help-block">
                                            <button class="form-control select-user" type="button" data-title="选择">{$info.user.nickName}</button>
                                            <input type="hidden" name="createUser" value="{$info.createUser}">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        动态内容<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <textarea name="content" class="form-control" cols="80" rows="10">{$info.content}</textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        图片<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <div id="upload-image">
                                            {foreach name="imagesList" item="images"}
                                            <span class="multi-image">
                                                <input type="hidden" name="imgIds" value="{$images.id}">
                                                <input type="hidden" name="imgUrl" value="{$images.imgUrl}">
                                                <img class="exist-image" src="{$images.imgUrl}" alt="">
                                                <img class="del" src="__STATIC__/pages/image/del.png" alt="">
                                            </span>
                                            {/foreach}
                                            <span id="upload-btn" data-multi="true" data-total="9" data-field="imgUrl">
                                                <img src="__STATIC__/admin/img/default.png" alt="图片上传" style="width: 100px;height: 100px;" />
                                            </span>
                                        </div>
                                        <span class="help-block"> 最多上传9张 (建议尺寸：320*320) </span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <input type="hidden" name="id" value="{$info.id}">
                        <input type="hidden" name="imgcount" value="{$imagesList|count}">

                        <hr />
                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" id="form-submit" class="btn blue save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    {if condition="($dongtaicheckoff == 1)"}
                                    <button type="button" data-value="1" class="btn green checkPass-btn" {if condition="($info.isPass == 1)"}disabled{/if}>
                                        通过 <i class="glyphicon glyphicon-ok"></i>
                                    </button>
                                    <button type="button" data-value="2" class="btn red checkPass-btn" {if condition="($info.isPass == 2)"}disabled{/if}>
                                        不通过 <i class="glyphicon glyphicon-remove"></i>
                                    </button>
                                    {/if}
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 详情 模态框 -->
<div class="modal fade" id="user-modal" data-backdrop="static" data-keyboard="false" >
    <div class="modal-dialog" style="width:800px; height: 520px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">x</button>
                <h4 class="modal-title">发布人</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12">
                        <div class="portlet light" style="margin-bottom: 0;">
                            <div class="box-header">
                                <div class="row">
                                    <div class="col-md-10">
                                        <form id="searchForm" action="" class="form" method="post">
                                            <div class="form-inline">
                                                <input type="text" class="form-control" name="name" value="" placeholder="姓名">
                                                &nbsp;&nbsp;&nbsp;
                                                <button id="doSearch" type="button" class="btn btn-success" title="搜索">
                                                    <i class="fa fa-search"></i> 搜索
                                                </button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                            <div class="portlet-body">
                                <form id="joinmeeting-form" action="" class="form-horizontal" name="ajaxForm">
                                    <div class="">
                                        <table id="user-datatable" class="table table-bordered table-hover dataTable">
                                            <thead>
                                            <th>头像</th>
                                            <th>姓名</th>
                                            <th>性别</th>
                                            <th>职务</th>
                                            <th>操作</th>
                                            </thead>
                                        </table>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <!--<button type="button" class="btn blue saveMember-btn"> 确定 </button>-->
                <button type="button" class="btn default" data-dismiss="modal"> 关闭 </button>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">

<input type="hidden" class="save_url" value="{:url('admin/'.strtolower($model).'/editpost')}">
<input type="hidden" class="checkPass_url" value="{:url('admin/'.strtolower($model).'/checkpass')}">

<input type="hidden" class="userDatalist_url" value="{:url('admin/'.strtolower($model).'/userlist')}">
{/block}

{block name="pagescript"}
<script type="text/javascript">
    var del_img_url = "{:url('admin/Image/delete')}";
    var total = 9;
    var imgcount = "{$imagesList|count}";
</script>
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/uploadfile.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/dynamic.js" type="text/javascript"></script>
{/block}